home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / serien / purity / nr.10 / demo / sparx.i / .spark07.i < prev    next >
Text File  |  1995-04-19  |  1KB  |  68 lines

  1.  
  2. Procedure Spark07( rgbx : ColorArrayPtr );
  3. Const
  4.     max4lines = 100;
  5.  
  6.     add1 : Short = 7;    { x1 }
  7.     add2 : Short = 3;    { y1 }
  8.     add3 : Short = 13;    { x2 }
  9.     add4 : Short = 7;    { y2 }
  10.  
  11. Type
  12.     Sp1lines    = Array[1..max4lines] of line;
  13.     Sp1LinesPtr = ^Sp1Lines;
  14.  
  15. Var
  16.     arr    : Sp1LinesPtr;
  17.     cnt1,
  18.     cnt2,
  19.     cnt3,
  20.     cnt4,
  21.     CCNT,
  22.     actualline : Short;
  23. Begin
  24.     New(arr);
  25.     ActualLine := 1;
  26.     SetSColors( rgbx );
  27.  
  28.     cnt1 := 546;    cnt2 := 3;
  29.     cnt3 := 197;    cnt4 := 401;
  30.     CCNT := 1;    { color }
  31.  
  32.     Repeat
  33.       EraseLine( Adr(arr^[actualline]) );
  34.       With arr^[actualline] do begin
  35.         x1 := 170 + XSin^[cnt1] *  6 DIV  5;    { +- max.120 }
  36.         y1 := 110 + Xsin^[cnt2] * 11 DIV 10;    { +- max.110 }
  37.         x2 := 160 + XSin^[cnt3] *  7 DIV  5;    { +- max.140 }
  38.         y2 := 120 + Xsin^[cnt4];            { +- max.100 }
  39.       end;
  40.  
  41.       cnt1 := cnt1 + add1;
  42.       if cnt1>627 then cnt1:= cnt1-628;
  43.  
  44.       cnt2 := cnt2 + add2;
  45.       if cnt2>627 then cnt2:= cnt2-628;
  46.  
  47.       cnt3 := cnt3 + add3;
  48.       if cnt3>627 then cnt3:= cnt3-628;
  49.  
  50.       cnt4 := cnt4 + add4;
  51.       if cnt4>627 then cnt4:= cnt4-628;
  52.  
  53.       DrawLine( Adr(arr^[actualline]), CCNT );
  54.  
  55.       inc( CCNT );
  56.       If CCNT > maxColors then CCNT := 2;
  57.  
  58.       inc( actualline );
  59.       If actualline >= max4lines then actualline := 1;
  60.  
  61.     Until LeftMouseButton;
  62.  
  63.     Ciao;
  64.     Dispose(arr);
  65.     SetSColors( Adr(Def_Colors) );
  66. End;
  67.  
  68.